import { Badge } from "antd";
import { messages } from "share/common";

export const reasonsColumns = (onEdit) => {
  return [
    {
      title: messages("common.column.status") /*状态*/,
      dataIndex: "isEnable",
      key: "isEnable",
      render: (text, row, index) => {
        return text ? (
          <Badge status="success" text={messages("supplier-1.key351") /* 已启用*/} />
        ) : (
          <Badge status="default" text={messages("supplier-1.key124") /* 未启用*/} />
        );
      },
    },
    {
      title: messages("supplier-1.key854") /*顺序号*/,
      dataIndex: "sortNumber",
      key: "sortNumber",
    },
    {
      title: messages("supplier-1.key855") /*编码*/,
      dataIndex: "reasonCode",
      key: "reasonCode",
    },
    {
      title: messages("supplier-1.key856") /*值名称*/,
      key: "reasonName",
      dataIndex: "reasonName",
    },
    {
      title: messages("common.operation") /*操作*/,
      key: "operator",
      dataIndex: "operator",
      render: (...args) => <a onClick={() => onEdit(...args)}>编辑</a>,
    },
  ];
};
